<template>
	<view style="height: 100vh; background-color: #FFFFFF;">
		<u-navbar title-color="#FFFFFF" height="48" back-icon-color="#FFFFFF" :border-bottom="false" :is-fixed="true" :title="'设备详情'"></u-navbar>
		<u-cell-group v-model="Deviceinfo">
			<u-cell-item :border-bottom="true" title="设备名称" :value="Deviceinfo.name" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备编码" :value="Deviceinfo.code" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备类型" :value="Deviceinfo.type" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备厂家" :value="Deviceinfo.manufactor" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="企业名称" :value="Deviceinfo.enterpriseName" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备楼层" :value="Deviceinfo.floor" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备地址" :value="Deviceinfo.address" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备安装时间" :value="Deviceinfo.installTime | dateFormat" :arrow="false"></u-cell-item>
			<u-cell-item :border-bottom="true" title="设备状态" :value="Deviceinfo.status |status" :arrow="false"></u-cell-item>
			<u-button @click="ToMaintenaceList" type="primary" shape="square" size="medium" style="margin-top: 20px; margin-left: 30px;">维保</u-button>
			<u-button @click="ToInspectionList" type="primary" shape="square" size="medium" style="margin-left:90px ;">巡检</u-button>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Deviceinfo: []
			}
		},
		onLoad(e) {
			console.log(e.ucId)
				this.getEquipmentInfo(e.ucId)
				
		},
		methods: {
			getEquipmentInfo(val) {
				this.utils.request("/api/app/equipment/getInEquipmentVo", {deleted:false,ucId: val}, "post", "app", true).then(res => {
					this.Deviceinfo = res.data
				}).catch(error => {
					console.log(error)
				})
			},
			ToMaintenaceList(){
				console.log("abc")
				uni.navigateTo({
					url:"/pages/index/equipment/Maintenance/list?ucId="+this.Deviceinfo.ucId	
				})
			},
			ToInspectionList(){
				console.log(this.Deviceinfo.ucId)
				uni.navigateTo({
					url:"/pages/index/equipment/Inspection/list?ucId="+this.Deviceinfo.ucId	
				})
			}
		}
	}
	
</script>

<style>

</style>
